<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 制定一个剧本(关键帧) */
        
        @keyframes zrc {
            0% {
                transform: translate(0);
            }
            25% {
                transform: translate(100px, -50px);
            }
            50% {
                transform: translate(100px, 0);
            }
            75% {
                transform: translate(250px, -300px);
            }
            100% {
                transform: translate(300px, 0);
            }
        }
        
        .zrc {
            width: 100px;
            height: 100px;
            /* background-color: tomato; */
            color: white;
            font-size: 30px;
            margin-top: 300px;
            /*动画名字 就是用哪个剧本*/
            animation-name: zrc;
            /*动画的执行时间*/
            animation-duration: 3s;
            /* 动画执行顺序  (reverse 反向)    (normal 正向，默认值)*/
            animation-direction: reverse;
        }
        
        img {
            width: 100%;
        }
        
        .box {
            width: 500px;
            height: 30px;
            background-color: #666;
            border-radius: 10px;
        }
        
        @keyframes zhang {
            0% {
                width: 0;
            }
            100% {
                width: 100%;
            }
        }
        
        .bar {
            width: 0;
            height: 30px;
            background-color: tomato;
            border-radius: 10px;
            animation-name: zhang;
            animation-duration: 5s;
            /*匀速运动*/
            animation-timing-function: linear;
            /* animation-timing-function: ease-in;
            animation-timing-function: ease-in-out;
            animation-timing-function: ease-out; */
            animation-timing-function: steps(5, start);
            /* 动画在最后一步完成之后呈什么状态 */
            /* forwards 保持动画结束后的状态 */
            animation-fill-mode: forwards;
            /* 动画结束后回到最初的状态 */
            animation-fill-mode: backwards;
        }
    </style>
</head>

<body>
    <!-- animation 动画 -->
    <div class="zrc"><img src="./img/杀敌.png" alt=""></div>
    <!-- 进度条 -->
    <div class="box">
        <div class="bar"></div>
    </div>
</body>

</html>